<template>
  <div>
    <h2>{{ $store.state.count }}</h2>

    <h2>+++++++++++++++++</h2>
    <h2>{{ more20age }}</h2>
    <h2>{{ more20agelength }}</h2>
    <h2>{{ moreAgeStu(20) }}</h2>
  </div>
</template>

<script>
export default {
  name: "homework",
  computed: {
    more20age() {
      return this.$store.state.students.filter(s => s.age > 20);
    },
    more20agelength() {
      return this.more20age.length;
    },
    moreAgeStu() {
      return function(age) {
        return this.$store.state.students.filter(s => s.age > age);
      };
    }
  }
};
</script>

<style></style>
